const cloud = require('wx-server-sdk')
const got = require('got'); //引用 gotnpm i got@9.6.0 --save

cloud.init()
 
 // 云函数入口函数
 exports.main = async(event, context) => { 
  var tdata = event.data.trim();
   let postResponse = await got('url', { 
     method: 'POST', //post请求
     headers: {'Content-Type':'application/json'},
     body: tdata
   }) 
   return postResponse.body //返回数据
 }
 